package array

// 不考虑顺序的情况下，先遍历物品
func change(amount int, coins []int) int {

	dp := make([]int, amount+1)
	dp[0] = 1
	for i := range coins {
		for j := range dp {
			if j-coins[i] >= 0 {
				dp[j] += dp[j-coins[i]]
			}
		}
	}
	return dp[amount]

}
